/*************************************************** * This is a routine to test the basic functions * of the board used in 330/340 in 05-06. * It does the following: * COunts up and down on the LED's twice * Writes a message to the LCD * runs an 57600 a terminal program which * echoes character to the screen and to the LCD * * ************************************************/ #include #include "ioF.h" #pragma DATA _CONFIG1H, _OSC_HS_1H //10 mhz #pragma DATA _CONFIG2H, _WDT_OFF_2H #pragma DATA _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L #pragma DATA _CONFIG3H, _MCLRE_ON_3H #pragma CLOCK_FREQ 10000000 /* global variables */ void main(void) { char j; char a; serial_init(42); // 57600 at 10 MHz adcon1 = 0x0f; LCD_init(); LCD_printf("Senior Design 08/09"); delay_s(3); LCD_clear(); LCD_printf("Blinking Lights"); LCD_setpos(1,0); LCD_printf("on port D LED's"); trisd = 0 ; // port d output for(j = 0; j < 255; ++j) { latd = ~j; delay_ms(10); } for(j = 0; j < 255; ++j) { latd = j; delay_ms(10); } delay_s(1); LCD_clear(); LCD_printf("57600 baud term test:"); LCD_setpos(1,0); LCD_printf("Type on terminal"); LCD_setpos(0,0); while(1) { a=getc(); LCD_char(a); if(a == '\r') printf("\r\n"); putc(a); } }